import { PayloadMcuid } from '@libs/common/decorator';
import { Controller, Get, Query } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';

import { DeliverService } from './deliver.service';

@ApiTags('ATM状态')
@Controller('atm')
export class DeliverController {
  constructor(private readonly deliverService: DeliverService) {}

  @Get('order')
  order(@Query('transNo') transNo: string, @PayloadMcuid() mcuid: string) {
    if (!transNo) throw new Error('transNo is required');
    return this.deliverService.order(mcuid, transNo);
  }
}
